package com.xxx.corejava.day1203;

public class Circle {
    private Point center;
    private double r;

    public Circle(Point center, double r) {
        this.center = center;
        this.r = r;
    }

    public Circle(double x,double y,double r) {
        this(new Point(x,y),r);
    }

    public Circle(double r) {
        this(new Point(),r);
    }

    public Circle() {
        this(1);
    }


    public double area(){
        return Math.PI*r*r;
    }

    public boolean contains(Point point){
        return point.distance(center)<r;
    }


    public boolean contains(double x,double y){
        return contains(new Point(x,y));
    }










    public Point getCenter() {
        return center;
    }

    public void setCenter(Point center) {
        this.center = center;
    }

    public double getR() {
        return r;
    }

    public void setR(double r) {
        this.r = r;
    }
}
